<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Sp/index')}">商品信息</a></li>
        <li><a href="{:url('Sp/add')}">添加商品</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="get" action="{:url('Sp/index')}">
        商品:
        <input type="text" class="form-control" name="title" style="width: 120px;" value="{:input('request.title/s','')}" placeholder="请输入商品名称">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('Sp/index')}">清空</a>
    </form>
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th>ID</th>
            <th>封面</th>
            <th>名称</th>
            <th>自营</th>
            <th>图册</th>
            <th>状态</th>
            <th>运费</th>
            <th>分类id</th>
            <th>创建时间</th>
            <th>修改时间</th>
            <th>操作</th>
        </tr>
        </thead>

        <tbody>
        <foreach name="list" item="vo">
            <tr>
                <td>{$vo.id}</td>
                <td><img src="/upload/{$vo.image}" style="width: 40px"></td>
                <td>{$vo.title}</td>
                <td>
                    <switch name="$vo.self_status">
                        <case value="1">
                            <a href="{:url('Sp/yc',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="确定不是自营吗？">
                                <span class="btn btn-success btn-xs" >是</span>
                            </a>
                        </case>
                        <case value="0">
                            <a href="{:url('Sp/yc',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="确定是自营吗？">
                                <span class="btn btn-success btn-danger btn-xs" >否</span>
                            </a>
                        </case>
                    </switch>
                </td>
                <td>
                    <foreach name="$vo['images']" item="img">
                        <img src="/upload/{$img}" class="img-thumbnail" onclick="imagePreviewDialog(this.src)" style="width: 80px;">
                    </foreach>
                </td>
                <td>
                    <switch name="$vo.status">
                        <case value="1">
                            <span class="btn btn-success btn-xs">正常</span>
                        </case>
                        <case value="2">
                            <span class="btn btn-warning btn-xs">下架</span>
                        </case>
                        <case value="0">
                            <span class="btn btn-danger btn-xs">无货</span>
                        </case>
                    </switch>
                </td>
                <td>{$vo.fare}</td>
                <td>{$vo.class_id}</td>
                <td>{$vo.create_time|date="Y-m-d H:i:s"}</td>
                <td>{$vo.update_time|date="Y-m-d H:i:s"}</td>
                <td>
                    <div class="btn-group" role="group">
                        <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="false" aria-haspopup="true">
                            商品配置<span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu">
                            <li>
                                <a href="javascript:void(0);" onclick="openIframeLayer('pz?goods_id={$vo.id}','配置商品属性',{area: ['60%','80%']})">配置商品属性</a>
                            </li>
                            <li>
                                <a href="javascript:void(0);"  onclick="openIframeLayer('pzValue?goods_id={$vo.id}','配置商品属性值',{area: ['60%','80%']})">配置商品属性值</a>
                            </li>
                        </ul>
                    </div>
                    <a class="btn btn-xs btn-primary" title="{:lang('EDIT')}" data-toggle="tooltip" href="{:url('Sp/edit')}?id={$vo.id}">
                        <i class="fa fa-edit fa-fw"></i>
                    </a>
                    <a href="{:url('Sp/delete',array('id'=>$vo['id']))}" class="js-ajax-delete btn btn-xs btn-danger" data-msg="确定删除它吗？">
                        <i class="fa fa-trash fa-fw"></i>
                    </a>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>

</div>
<div>
    <div class="pagination">{$list->render()}</div>
    <div>共有{$list->total()}条，每页显示{$list->listRows()}条，当前第{$list->currentPage()}页，共{$list->lastPage()}页。</div>
</div>
<script src="__STATIC__/js/admin.js?v={$_static_version}"></script>
</body>
</html>